package homework7.soso.menu;

import homework7.soso.untils.CardUtil;

import java.util.Scanner;

/**
 * @author fengq
 * soso的二级菜单
 */
public class SosoMenu {
    CardUtil cardUtil;
    public void cardMenu(CardUtil cardUtil,String numbers) {
        this.cardUtil = cardUtil;
        boolean isExit = true;
        Scanner input = new Scanner(System.in);
        do {
            System.out.println("嗖嗖移动用户菜单");
            System.out.println("1.本月账单查询");
            System.out.println("2.套餐余量查询");
            System.out.println("3.打印消费详单");
            System.out.println("4.套餐变更");
            System.out.println("5.办理退网");
            System.out.println("请选择（输入1-5选择功能，其他键返回上一级:）");
            String number =input.next();

            switch (number) {
                // 查询本月账单
                case "1":
                    cardUtil.showAmountDetail(numbers);
                    break;
                //套餐余量查询
                case "2":
                    cardUtil.showRemainDetail(numbers);
                    break;
                //打印消费详单
                case "3":
                    cardUtil.printConsumeInfo(numbers);
                    break;
                //套餐变更
                case "4":
                    cardUtil.changingPack(numbers);
                    break;
                // 办理退网
                case "5":
                    cardUtil.delCard(numbers);
                    isExit = false;
                    break;
                default :
                    isExit = false;
                    break;
            }

        } while (isExit);
    }
}
